<style>
    .layui-form-item .layui-input-company {
        width: auto;
        padding-right: 10px;
        line-height: 38px;
    }
</style>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form">
            <div class="layui-tab layui-tab-card">
                <ul class="layui-tab-title">
                    <li class="layui-this">网站设置</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">网站名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="title" lay-verify="required" lay-reqtext="网站名称不能为空"
                                       placeholder="请输入网站名称" value="{:sysConf('title')}" class="layui-input">
                                <tip>填写网站名称。</tip>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">META关键词</label>
                            <div class="layui-input-block">
                                <textarea name="keywords" class="layui-textarea"
                                          placeholder="多个关键词用英文状态 , 号分割">{:sysConf('keywords')}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">META描述</label>
                            <div class="layui-input-block">
                                <textarea name="description" class="layui-textarea" placeholder="输入网站描述">{:sysConf('description')}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label required">版权信息</label>
                            <div class="layui-input-block">
                                <textarea name="copy" class="layui-textarea" placeholder="输入版权信息">{:sysConf('copy')}</textarea>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        let form = layui.form
            , $ = layui.$;

        form.on('submit(setting)', function (obj) {
            $.post("{:url('add')}", obj.field, function (res) {
                if (res.code == "{$result.success}") {
                    layer.msg(res.msg, {icon: 6, shade: 0.5},function () {
                        window.location.reload()
                    })
                } else {
                    layer.msg(res.msg, {icon: 5, shade: 0.5})
                }
            })
            return false;
        })
    })
</script>
